<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>语言参考</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="configuration.changes.html">« 怎样修改配置设定</a></li>
      <li style="float: right;"><a href="language.basic-syntax.html">基本语法 »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    
    <li>语言参考</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="langref" class="book">
  <h1 class="title">语言参考</h1>
  








  






  



 



  




 



  



 



  



 



  







  







  








  







  




 

  





 


  




 


  




 


  







  




 



  








  




 

 

  








  








  




  





 



  








 <ul class="chunklist chunklist_book"><li><a href="language.basic-syntax.html">基本语法</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="language.basic-syntax.phptags.html">PHP 标记</a></li><li><a href="language.basic-syntax.phpmode.html">从 HTML 中分离</a></li><li><a href="language.basic-syntax.instruction-separation.html">指令分隔符</a></li><li><a href="language.basic-syntax.comments.html">注释</a></li></ul></li><li><a href="language.types.html">类型</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="language.types.intro.html">简介</a></li><li><a href="language.types.type-system.html">类型系统</a></li><li><a href="language.types.null.html">NULL</a></li><li><a href="language.types.boolean.html">Boolean 布尔类型</a></li><li><a href="language.types.integer.html">Integer 整型</a></li><li><a href="language.types.float.html">Float 浮点型</a></li><li><a href="language.types.string.html">String 字符串</a></li><li><a href="language.types.numeric-strings.html">数字字符串</a></li><li><a href="language.types.array.html">Array 数组</a></li><li><a href="language.types.object.html">Object 对象</a></li><li><a href="language.types.enumerations.html">Enum 枚举</a></li><li><a href="language.types.resource.html">Resource 资源类型</a></li><li><a href="language.types.callable.html">Callback / Callable 类型</a></li><li><a href="language.types.mixed.html">Mixed</a></li><li><a href="language.types.void.html">Void</a></li><li><a href="language.types.never.html">Never</a></li><li><a href="language.types.relative-class-types.html">相对类类型</a></li><li><a href="language.types.literal.html">literal 类型</a></li><li><a href="language.types.iterable.html">Iterable 可迭代对象</a></li><li><a href="language.types.declarations.html">类型声明</a></li><li><a href="language.types.type-juggling.html">类型转换</a></li></ul></li><li><a href="language.variables.html">变量</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="language.variables.basics.html">基础</a></li><li><a href="language.variables.predefined.html">预定义变量</a></li><li><a href="language.variables.scope.html">变量范围</a></li><li><a href="language.variables.variable.html">可变变量</a></li><li><a href="language.variables.external.html">来自 PHP 之外的变量</a></li></ul></li><li><a href="language.constants.html">常量</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="language.constants.syntax.html">语法</a></li><li><a href="language.constants.predefined.html">预定义常量</a></li><li><a href="language.constants.magic.html">魔术常量</a></li></ul></li><li><a href="language.expressions.html">表达式</a></li><li><a href="language.operators.html">运算符</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="language.operators.precedence.html">运算符优先级</a></li><li><a href="language.operators.arithmetic.html">算术运算符</a></li><li><a href="language.operators.assignment.html">赋值运算符</a></li><li><a href="language.operators.bitwise.html">位运算符</a></li><li><a href="language.operators.comparison.html">比较运算符</a></li><li><a href="language.operators.errorcontrol.html">错误控制运算符</a></li><li><a href="language.operators.execution.html">执行运算符</a></li><li><a href="language.operators.increment.html">递增／递减运算符</a></li><li><a href="language.operators.logical.html">逻辑运算符</a></li><li><a href="language.operators.string.html">字符串运算符</a></li><li><a href="language.operators.array.html">数组运算符</a></li><li><a href="language.operators.type.html">类型运算符</a></li></ul></li><li><a href="language.control-structures.html">流程控制</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="control-structures.intro.html">简介</a></li><li><a href="control-structures.if.html">if</a></li><li><a href="control-structures.else.html">else</a></li><li><a href="control-structures.elseif.html">elseif/else if</a></li><li><a href="control-structures.alternative-syntax.html">流程控制的替代语法</a></li><li><a href="control-structures.while.html">while</a></li><li><a href="control-structures.do.while.html">do-while</a></li><li><a href="control-structures.for.html">for</a></li><li><a href="control-structures.foreach.html">foreach</a></li><li><a href="control-structures.break.html">break</a></li><li><a href="control-structures.continue.html">continue</a></li><li><a href="control-structures.switch.html">switch</a></li><li><a href="control-structures.match.html">match</a></li><li><a href="control-structures.declare.html">declare</a></li><li><a href="function.return.html">return</a></li><li><a href="function.require.html">require</a></li><li><a href="function.include.html">include</a></li><li><a href="function.require-once.html">require_once</a></li><li><a href="function.include-once.html">include_once</a></li><li><a href="control-structures.goto.html">goto</a></li></ul></li><li><a href="language.functions.html">函数</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="functions.user-defined.html">用户自定义函数</a></li><li><a href="functions.arguments.html">函数的参数</a></li><li><a href="functions.returning-values.html">返回值</a></li><li><a href="functions.variable-functions.html">可变函数</a></li><li><a href="functions.internal.html">内部（内置）函数</a></li><li><a href="functions.anonymous.html">匿名函数</a></li><li><a href="functions.arrow.html">箭头函数</a></li><li><a href="functions.first_class_callable_syntax.html">First class callable syntax</a></li></ul></li><li><a href="language.oop5.html">类与对象</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="oop5.intro.html">简介</a></li><li><a href="language.oop5.basic.html">基本概念</a></li><li><a href="language.oop5.properties.html">属性</a></li><li><a href="language.oop5.constants.html">类常量</a></li><li><a href="language.oop5.autoload.html">类的自动加载</a></li><li><a href="language.oop5.decon.html">构造函数和析构函数</a></li><li><a href="language.oop5.visibility.html">访问控制（可见性）</a></li><li><a href="language.oop5.inheritance.html">对象继承</a></li><li><a href="language.oop5.paamayim-nekudotayim.html">范围解析操作符 （::）</a></li><li><a href="language.oop5.static.html">静态（static）关键字</a></li><li><a href="language.oop5.abstract.html">抽象类</a></li><li><a href="language.oop5.interfaces.html">对象接口</a></li><li><a href="language.oop5.traits.html">Trait</a></li><li><a href="language.oop5.anonymous.html">匿名类</a></li><li><a href="language.oop5.overloading.html">重载</a></li><li><a href="language.oop5.iterations.html">遍历对象</a></li><li><a href="language.oop5.magic.html">魔术方法</a></li><li><a href="language.oop5.final.html">Final 关键字</a></li><li><a href="language.oop5.cloning.html">对象复制</a></li><li><a href="language.oop5.object-comparison.html">对象比较</a></li><li><a href="language.oop5.late-static-bindings.html">后期静态绑定</a></li><li><a href="language.oop5.references.html">对象和引用</a></li><li><a href="language.oop5.serialization.html">对象序列化</a></li><li><a href="language.oop5.variance.html">协变与逆变</a></li><li><a href="language.oop5.changelog.html">OOP 变更日志</a></li></ul></li><li><a href="language.namespaces.html">命名空间</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="language.namespaces.rationale.html">命名空间概述</a></li><li><a href="language.namespaces.definition.html">定义命名空间</a></li><li><a href="language.namespaces.nested.html">定义子命名空间</a></li><li><a href="language.namespaces.definitionmultiple.html">在同一个文件中定义多个命名空间</a></li><li><a href="language.namespaces.basics.html">使用命名空间：基础</a></li><li><a href="language.namespaces.dynamic.html">命名空间和动态语言特征</a></li><li><a href="language.namespaces.nsconstants.html">namespace 关键字和 __NAMESPACE__ 常量</a></li><li><a href="language.namespaces.importing.html">使用命名空间：别名/导入</a></li><li><a href="language.namespaces.global.html">全局空间</a></li><li><a href="language.namespaces.fallback.html">使用命名空间：后备全局函数/常量</a></li><li><a href="language.namespaces.rules.html">名称解析规则</a></li><li><a href="language.namespaces.faq.html">FAQ：命名空间必知必会</a></li></ul></li><li><a href="language.enumerations.html">枚举</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="language.enumerations.overview.html">枚举概览</a></li><li><a href="language.enumerations.basics.html">枚举基础</a></li><li><a href="language.enumerations.backed.html">回退（Backed）枚举</a></li><li><a href="language.enumerations.methods.html">枚举方法</a></li><li><a href="language.enumerations.static-methods.html">枚举静态方法</a></li><li><a href="language.enumerations.constants.html">枚举常量</a></li><li><a href="language.enumerations.traits.html">Trait</a></li><li><a href="language.enumerations.expressions.html">常量表达式的枚举值</a></li><li><a href="language.enumerations.object-differences.html">和对象的差异</a></li><li><a href="language.enumerations.listing.html">枚举值清单</a></li><li><a href="language.enumerations.serialization.html">序列化</a></li><li><a href="language.enumerations.examples.html">范例</a></li></ul></li><li><a href="language.errors.html">错误</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="language.errors.basics.html">基础概要</a></li><li><a href="language.errors.php7.html">PHP 7 错误处理</a></li></ul></li><li><a href="language.exceptions.html">异常</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="language.exceptions.extending.html">扩展（extend）异常处理类</a></li></ul></li><li><a href="language.fibers.html">纤程</a></li><li><a href="language.generators.html">生成器</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="language.generators.overview.html">生成器总览</a></li><li><a href="language.generators.syntax.html">生成器语法</a></li><li><a href="language.generators.comparison.html">生成器与 Iterator 对象的比较</a></li></ul></li><li><a href="language.attributes.html">注解</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="language.attributes.overview.html">注解概览</a></li><li><a href="language.attributes.syntax.html">注解语法</a></li><li><a href="language.attributes.reflection.html">使用反射 API 读取注解</a></li><li><a href="language.attributes.classes.html">声明注解类</a></li></ul></li><li><a href="language.references.html">引用的解释</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="language.references.whatare.html">引用是什么</a></li><li><a href="language.references.whatdo.html">引用做什么</a></li><li><a href="language.references.arent.html">引用不是什么</a></li><li><a href="language.references.pass.html">引用传递</a></li><li><a href="language.references.return.html">引用返回</a></li><li><a href="language.references.unset.html">取消引用</a></li><li><a href="language.references.spot.html">引用定位</a></li></ul></li><li><a href="reserved.variables.html">预定义变量</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="language.variables.superglobals.html">超全局变量</a> — 在全部作用域中始终可用的内置变量</li><li><a href="reserved.variables.globals.html">$GLOBALS</a> — 引用全局作用域中可用的全部变量</li><li><a href="reserved.variables.server.html">$_SERVER</a> — 服务器和执行环境信息</li><li><a href="reserved.variables.get.html">$_GET</a> — HTTP GET 变量</li><li><a href="reserved.variables.post.html">$_POST</a> — HTTP POST 变量</li><li><a href="reserved.variables.files.html">$_FILES</a> — HTTP 文件上传变量</li><li><a href="reserved.variables.request.html">$_REQUEST</a> — HTTP Request 变量</li><li><a href="reserved.variables.session.html">$_SESSION</a> — Session 变量</li><li><a href="reserved.variables.environment.html">$_ENV</a> — 环境变量</li><li><a href="reserved.variables.cookies.html">$_COOKIE</a> — HTTP Cookies</li><li><a href="reserved.variables.phperrormsg.html">$php_errormsg</a> — 前一个错误信息</li><li><a href="reserved.variables.httpresponseheader.html">$http_response_header</a> — HTTP 响应头</li><li><a href="reserved.variables.argc.html">$argc</a> — 传递给脚本的参数数目</li><li><a href="reserved.variables.argv.html">$argv</a> — 传递给脚本的参数数组</li></ul></li><li><a href="reserved.exceptions.html">预定义异常</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="class.exception.html">Exception</a></li><li><a href="class.errorexception.html">ErrorException</a></li><li><a href="class.error.html">Error</a></li><li><a href="class.argumentcounterror.html">ArgumentCountError</a></li><li><a href="class.arithmeticerror.html">ArithmeticError</a></li><li><a href="class.assertionerror.html">AssertionError</a></li><li><a href="class.divisionbyzeroerror.html">DivisionByZeroError</a></li><li><a href="class.compileerror.html">CompileError</a></li><li><a href="class.parseerror.html">ParseError</a></li><li><a href="class.typeerror.html">TypeError</a></li><li><a href="class.valueerror.html">ValueError</a></li><li><a href="class.unhandledmatcherror.html">UnhandledMatchError</a></li><li><a href="class.fibererror.html">FiberError</a></li></ul></li><li><a href="reserved.interfaces.html">预定义接口和类</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="class.traversable.html">Traversable</a> — Traversable （遍历）接口</li><li><a href="class.iterator.html">Iterator</a> — Iterator（迭代器）接口</li><li><a href="class.iteratoraggregate.html">IteratorAggregate</a> — IteratorAggregate（聚合式迭代器）接口</li><li><a href="class.internaliterator.html">InternalIterator</a> — The InternalIterator class</li><li><a href="class.throwable.html">Throwable</a></li><li><a href="class.arrayaccess.html">ArrayAccess</a> — ArrayAccess（数组式访问）接口</li><li><a href="class.serializable.html">Serializable</a> — Serializable 接口</li><li><a href="class.closure.html">Closure</a> — Closure 类</li><li><a href="class.stdclass.html">stdClass</a> — stdClass 类</li><li><a href="class.generator.html">Generator</a> — 生成器类</li><li><a href="class.fiber.html">Fiber</a> — 纤程（Fiber）类</li><li><a href="class.weakreference.html">WeakReference</a> — WeakReference 类</li><li><a href="class.weakmap.html">WeakMap</a> — WeakMap 类</li><li><a href="class.stringable.html">Stringable</a> — Stringable 接口</li><li><a href="class.unitenum.html">UnitEnum</a> — UnitEnum 接口</li><li><a href="class.backedenum.html">BackedEnum</a> — BackedEnum 接口</li></ul></li><li><a href="reserved.attributes.html">预定义注解</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="class.attribute.html">Attribute</a> — The Attribute class</li><li><a href="class.allow-dynamic-properties.html">AllowDynamicProperties</a> — AllowDynamicProperties 类</li><li><a href="class.return-type-will-change.html">ReturnTypeWillChange</a> — The ReturnTypeWillChange class</li><li><a href="class.sensitive-parameter.html">SensitiveParameter</a> — SensitiveParameter 类</li></ul></li><li><a href="context.html">上下文（Context）选项和参数</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="context.socket.html">套接字上下文选项</a> — 套接字上下文选项列表</li><li><a href="context.http.html">HTTP context 选项</a> — HTTP context 的选项列表</li><li><a href="context.ftp.html">FTP 上下文选项</a> — FTP 上下文选项列表</li><li><a href="context.ssl.html">SSL 上下文选项</a> — SSL 上下文选项清单</li><li><a href="context.curl.html">CURL 上下文选项</a> — CURL 上下文选项列表</li><li><a href="context.phar.html">Phar 上下文（context）选项</a> — Phar 上下文（context）选项列表</li><li><a href="context.params.html">Context 参数</a> — Context 参数列表</li><li><a href="context.zip.html">Zip 上下文选项</a> — Zip 上下文选项列表</li></ul></li><li><a href="wrappers.html">支持的协议和封装协议</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="wrappers.file.html">file://</a> — 访问本地文件系统</li><li><a href="wrappers.http.html">http://</a> — 访问 HTTP(s) 网址</li><li><a href="wrappers.ftp.html">ftp://</a> — 访问 FTP(s) URLs</li><li><a href="wrappers.php.html">php://</a> — 访问各个输入/输出流（I/O streams）</li><li><a href="wrappers.compression.html">zlib://</a> — 压缩流</li><li><a href="wrappers.data.html">data://</a> — 数据（RFC 2397）</li><li><a href="wrappers.glob.html">glob://</a> — 查找匹配的文件路径模式</li><li><a href="wrappers.phar.html">phar://</a> — PHP 归档</li><li><a href="wrappers.ssh2.html">ssh2://</a> — 安全外壳协议 2</li><li><a href="wrappers.rar.html">rar://</a> — RAR</li><li><a href="wrappers.audio.html">ogg://</a> — 音频流</li><li><a href="wrappers.expect.html">expect://</a> — 处理交互式的流</li></ul></li></ul></div></div></div></body></html>